import globalConfig


class Passenger:
    count = 0

    def __init__(self, req_floor=0, arr_floor=0, req_time=0):
        Passenger.count += 1
        self.id = self.count
        self.req_time = req_time
        self.ser_time = 0
        self.arr_time = 0
        self.req_floor = req_floor
        self.arr_floor = arr_floor
        self.direction = self.set_direction()

    def get_total_time(self):
        return self.arr_time - self.req_time

    def get_serve_time(self):
        return self.arr_time - self.ser_time

    def set_direction(self):
        if self.req_floor > self.arr_floor:
            return -1
        else:
            return 1